package com.netease.p.a;

import com.netease.n.a.a.e;
import com.netease.n.a.a.f;
import com.netease.n.a.a.g;
import com.netease.n.a.a.i;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;

public class a
  implements e, g
{
  static final int a = 76;
  static final byte[] b;
  private static final byte[] c;
  private static final byte d = 61;
  private static final byte[] e;
  private static final int f = 63;
  private static final int g = 255;
  private final int h;
  private final byte[] i;
  private final int j;
  private final int k;
  private byte[] l;
  private int m;
  private int n;
  private int o;
  private int p;
  private boolean q;
  private int r;

  static
  {
    byte[] arrayOfByte1 = new byte[2];
    arrayOfByte1[0] = 13;
    arrayOfByte1[1] = 10;
    b = arrayOfByte1;
    byte[] arrayOfByte2 = new byte[64];
    arrayOfByte2[0] = 65;
    arrayOfByte2[1] = 66;
    arrayOfByte2[2] = 67;
    arrayOfByte2[3] = 68;
    arrayOfByte2[4] = 69;
    arrayOfByte2[5] = 70;
    arrayOfByte2[6] = 71;
    arrayOfByte2[7] = 72;
    arrayOfByte2[8] = 73;
    arrayOfByte2[9] = 74;
    arrayOfByte2[10] = 75;
    arrayOfByte2[11] = 76;
    arrayOfByte2[12] = 77;
    arrayOfByte2[13] = 78;
    arrayOfByte2[14] = 79;
    arrayOfByte2[15] = 80;
    arrayOfByte2[16] = 81;
    arrayOfByte2[17] = 82;
    arrayOfByte2[18] = 83;
    arrayOfByte2[19] = 84;
    arrayOfByte2[20] = 85;
    arrayOfByte2[21] = 86;
    arrayOfByte2[22] = 87;
    arrayOfByte2[23] = 88;
    arrayOfByte2[24] = 89;
    arrayOfByte2[25] = 90;
    arrayOfByte2[26] = 97;
    arrayOfByte2[27] = 98;
    arrayOfByte2[28] = 99;
    arrayOfByte2[29] = 100;
    arrayOfByte2[30] = 101;
    arrayOfByte2[31] = 102;
    arrayOfByte2[32] = 103;
    arrayOfByte2[33] = 104;
    arrayOfByte2[34] = 105;
    arrayOfByte2[35] = 106;
    arrayOfByte2[36] = 107;
    arrayOfByte2[37] = 108;
    arrayOfByte2[38] = 109;
    arrayOfByte2[39] = 110;
    arrayOfByte2[40] = 111;
    arrayOfByte2[41] = 112;
    arrayOfByte2[42] = 113;
    arrayOfByte2[43] = 114;
    arrayOfByte2[44] = 115;
    arrayOfByte2[45] = 116;
    arrayOfByte2[46] = 117;
    arrayOfByte2[47] = 118;
    arrayOfByte2[48] = 119;
    arrayOfByte2[49] = 120;
    arrayOfByte2[50] = 121;
    arrayOfByte2[51] = 122;
    arrayOfByte2[52] = 48;
    arrayOfByte2[53] = 49;
    arrayOfByte2[54] = 50;
    arrayOfByte2[55] = 51;
    arrayOfByte2[56] = 52;
    arrayOfByte2[57] = 53;
    arrayOfByte2[58] = 54;
    arrayOfByte2[59] = 55;
    arrayOfByte2[60] = 56;
    arrayOfByte2[61] = 57;
    arrayOfByte2[62] = 43;
    arrayOfByte2[63] = 47;
    c = arrayOfByte2;
    byte[] arrayOfByte3 = new byte[123];
    arrayOfByte3[0] = -1;
    arrayOfByte3[1] = -1;
    arrayOfByte3[2] = -1;
    arrayOfByte3[3] = -1;
    arrayOfByte3[4] = -1;
    arrayOfByte3[5] = -1;
    arrayOfByte3[6] = -1;
    arrayOfByte3[7] = -1;
    arrayOfByte3[8] = -1;
    arrayOfByte3[9] = -1;
    arrayOfByte3[10] = -1;
    arrayOfByte3[11] = -1;
    arrayOfByte3[12] = -1;
    arrayOfByte3[13] = -1;
    arrayOfByte3[14] = -1;
    arrayOfByte3[15] = -1;
    arrayOfByte3[16] = -1;
    arrayOfByte3[17] = -1;
    arrayOfByte3[18] = -1;
    arrayOfByte3[19] = -1;
    arrayOfByte3[20] = -1;
    arrayOfByte3[21] = -1;
    arrayOfByte3[22] = -1;
    arrayOfByte3[23] = -1;
    arrayOfByte3[24] = -1;
    arrayOfByte3[25] = -1;
    arrayOfByte3[26] = -1;
    arrayOfByte3[27] = -1;
    arrayOfByte3[28] = -1;
    arrayOfByte3[29] = -1;
    arrayOfByte3[30] = -1;
    arrayOfByte3[31] = -1;
    arrayOfByte3[32] = -1;
    arrayOfByte3[33] = -1;
    arrayOfByte3[34] = -1;
    arrayOfByte3[35] = -1;
    arrayOfByte3[36] = -1;
    arrayOfByte3[37] = -1;
    arrayOfByte3[38] = -1;
    arrayOfByte3[39] = -1;
    arrayOfByte3[40] = -1;
    arrayOfByte3[41] = -1;
    arrayOfByte3[42] = -1;
    arrayOfByte3[43] = 62;
    arrayOfByte3[44] = -1;
    arrayOfByte3[45] = -1;
    arrayOfByte3[46] = -1;
    arrayOfByte3[47] = 63;
    arrayOfByte3[48] = 52;
    arrayOfByte3[49] = 53;
    arrayOfByte3[50] = 54;
    arrayOfByte3[51] = 55;
    arrayOfByte3[52] = 56;
    arrayOfByte3[53] = 57;
    arrayOfByte3[54] = 58;
    arrayOfByte3[55] = 59;
    arrayOfByte3[56] = 60;
    arrayOfByte3[57] = 61;
    arrayOfByte3[58] = -1;
    arrayOfByte3[59] = -1;
    arrayOfByte3[60] = -1;
    arrayOfByte3[61] = -1;
    arrayOfByte3[62] = -1;
    arrayOfByte3[63] = -1;
    arrayOfByte3[64] = -1;
    arrayOfByte3[65] = 0;
    arrayOfByte3[66] = 1;
    arrayOfByte3[67] = 2;
    arrayOfByte3[68] = 3;
    arrayOfByte3[69] = 4;
    arrayOfByte3[70] = 5;
    arrayOfByte3[71] = 6;
    arrayOfByte3[72] = 7;
    arrayOfByte3[73] = 8;
    arrayOfByte3[74] = 9;
    arrayOfByte3[75] = 10;
    arrayOfByte3[76] = 11;
    arrayOfByte3[77] = 12;
    arrayOfByte3[78] = 13;
    arrayOfByte3[79] = 14;
    arrayOfByte3[80] = 15;
    arrayOfByte3[81] = 16;
    arrayOfByte3[82] = 17;
    arrayOfByte3[83] = 18;
    arrayOfByte3[84] = 19;
    arrayOfByte3[85] = 20;
    arrayOfByte3[86] = 21;
    arrayOfByte3[87] = 22;
    arrayOfByte3[88] = 23;
    arrayOfByte3[89] = 24;
    arrayOfByte3[90] = 25;
    arrayOfByte3[91] = -1;
    arrayOfByte3[92] = -1;
    arrayOfByte3[93] = -1;
    arrayOfByte3[94] = -1;
    arrayOfByte3[95] = -1;
    arrayOfByte3[96] = -1;
    arrayOfByte3[97] = 26;
    arrayOfByte3[98] = 27;
    arrayOfByte3[99] = 28;
    arrayOfByte3[100] = 29;
    arrayOfByte3[101] = 30;
    arrayOfByte3[102] = 31;
    arrayOfByte3[103] = 32;
    arrayOfByte3[104] = 33;
    arrayOfByte3[105] = 34;
    arrayOfByte3[106] = 35;
    arrayOfByte3[107] = 36;
    arrayOfByte3[108] = 37;
    arrayOfByte3[109] = 38;
    arrayOfByte3[110] = 39;
    arrayOfByte3[111] = 40;
    arrayOfByte3[112] = 41;
    arrayOfByte3[113] = 42;
    arrayOfByte3[114] = 43;
    arrayOfByte3[115] = 44;
    arrayOfByte3[116] = 45;
    arrayOfByte3[117] = 46;
    arrayOfByte3[118] = 47;
    arrayOfByte3[119] = 48;
    arrayOfByte3[120] = 49;
    arrayOfByte3[121] = 50;
    arrayOfByte3[122] = 51;
    e = arrayOfByte3;
  }

  public a()
  {
    this(76, b);
  }

  public a(int paramInt)
  {
    this(paramInt, b);
  }

  public a(int paramInt, byte[] paramArrayOfByte)
  {
    this.h = paramInt;
    this.i = new byte[paramArrayOfByte.length];
    System.arraycopy(paramArrayOfByte, 0, this.i, 0, paramArrayOfByte.length);
    if (paramInt > 0)
      this.k = (4 + paramArrayOfByte.length);
    while (true)
    {
      this.j = (-1 + this.k);
      if (j(paramArrayOfByte))
        try
        {
          str = new String(paramArrayOfByte, "UTF-8");
          throw new IllegalArgumentException("lineSeperator must not contain base64 characters: [" + str + "]");
          this.k = 4;
        }
        catch (UnsupportedEncodingException localUnsupportedEncodingException)
        {
          while (true)
            String str = new String(paramArrayOfByte);
        }
    }
  }

  public static boolean a(byte paramByte)
  {
    if ((paramByte == 61) || ((paramByte >= 0) && (paramByte < e.length) && (e[paramByte] != -1)));
    for (int i1 = 1; ; i1 = 0)
      return i1;
  }

  public static byte[] a(BigInteger paramBigInteger)
  {
    if (paramBigInteger == null)
      throw new NullPointerException("encodeInteger called with null parameter");
    return a(b(paramBigInteger), false);
  }

  public static byte[] a(byte[] paramArrayOfByte, boolean paramBoolean)
  {
    if ((paramArrayOfByte == null) || (paramArrayOfByte.length == 0));
    while (true)
    {
      return paramArrayOfByte;
      if (paramBoolean);
      long l1;
      for (a locala = new a(); ; locala = new a(0))
      {
        l1 = 4 * paramArrayOfByte.length / 3;
        long l2 = l1 % 4L;
        if (l2 != 0L)
          l1 += 4L - l2;
        if (paramBoolean)
          l1 += (l1 + 76L - 1L) / 76L * b.length;
        if (l1 <= 2147483647L)
          break;
        throw new IllegalArgumentException("Input array too big, output array would be bigger than Integer.MAX_VALUE=2147483647");
      }
      byte[] arrayOfByte = new byte[(int)l1];
      locala.b(arrayOfByte, 0, arrayOfByte.length);
      locala.c(paramArrayOfByte, 0, paramArrayOfByte.length);
      locala.c(paramArrayOfByte, 0, -1);
      if (locala.l != arrayOfByte)
        locala.a(arrayOfByte, 0, arrayOfByte.length);
      paramArrayOfByte = arrayOfByte;
    }
  }

  private static boolean b(byte paramByte)
  {
    switch (paramByte)
    {
    default:
    case 9:
    case 10:
    case 13:
    case 32:
    }
    for (int i1 = 0; ; i1 = 1)
      return i1;
  }

  public static boolean b(byte[] paramArrayOfByte)
  {
    int i1 = 0;
    int i2 = 0;
    if (i2 < paramArrayOfByte.length)
      if ((a(paramArrayOfByte[i2])) || (b(paramArrayOfByte[i2])));
    while (true)
    {
      return i1;
      i2++;
      break;
      i1 = 1;
    }
  }

  static byte[] b(BigInteger paramBigInteger)
  {
    int i1 = 7 + paramBigInteger.bitLength() >> 3 << 3;
    byte[] arrayOfByte1 = paramBigInteger.toByteArray();
    if ((paramBigInteger.bitLength() % 8 != 0) && (1 + paramBigInteger.bitLength() / 8 == i1 / 8));
    byte[] arrayOfByte2;
    for (Object localObject = arrayOfByte1; ; localObject = arrayOfByte2)
    {
      return localObject;
      int i2 = 0;
      int i3 = arrayOfByte1.length;
      if (paramBigInteger.bitLength() % 8 == 0)
      {
        i2 = 1;
        i3--;
      }
      int i4 = i1 / 8 - i3;
      arrayOfByte2 = new byte[i1 / 8];
      System.arraycopy(arrayOfByte1, i2, arrayOfByte2, i4, i3);
    }
  }

  private void c()
  {
    if (this.l == null)
    {
      this.l = new byte[8192];
      this.m = 0;
      this.n = 0;
    }
    while (true)
    {
      return;
      byte[] arrayOfByte = new byte[2 * this.l.length];
      System.arraycopy(this.l, 0, arrayOfByte, 0, this.l.length);
      this.l = arrayOfByte;
    }
  }

  public static byte[] c(byte[] paramArrayOfByte)
  {
    return a(paramArrayOfByte, false);
  }

  public static byte[] d(byte[] paramArrayOfByte)
  {
    return a(paramArrayOfByte, true);
  }

  public static byte[] e(byte[] paramArrayOfByte)
  {
    if ((paramArrayOfByte == null) || (paramArrayOfByte.length == 0));
    while (true)
    {
      return paramArrayOfByte;
      a locala = new a();
      byte[] arrayOfByte = new byte[(int)(3 * paramArrayOfByte.length / 4)];
      locala.b(arrayOfByte, 0, arrayOfByte.length);
      locala.d(paramArrayOfByte, 0, paramArrayOfByte.length);
      locala.d(paramArrayOfByte, 0, -1);
      paramArrayOfByte = new byte[locala.m];
      locala.a(paramArrayOfByte, 0, paramArrayOfByte.length);
    }
  }

  static byte[] f(byte[] paramArrayOfByte)
  {
    byte[] arrayOfByte1 = new byte[paramArrayOfByte.length];
    int i1 = 0;
    int i2 = 0;
    while (i1 < paramArrayOfByte.length)
    {
      switch (paramArrayOfByte[i1])
      {
      default:
        int i3 = i2 + 1;
        arrayOfByte1[i2] = paramArrayOfByte[i1];
        i2 = i3;
      case 9:
      case 10:
      case 13:
      case 32:
      }
      i1++;
    }
    byte[] arrayOfByte2 = new byte[i2];
    System.arraycopy(arrayOfByte1, 0, arrayOfByte2, 0, i2);
    return arrayOfByte2;
  }

  static byte[] g(byte[] paramArrayOfByte)
  {
    byte[] arrayOfByte1 = new byte[paramArrayOfByte.length];
    int i1 = 0;
    int i2 = 0;
    while (i1 < paramArrayOfByte.length)
    {
      if (a(paramArrayOfByte[i1]))
      {
        int i3 = i2 + 1;
        arrayOfByte1[i2] = paramArrayOfByte[i1];
        i2 = i3;
      }
      i1++;
    }
    byte[] arrayOfByte2 = new byte[i2];
    System.arraycopy(arrayOfByte1, 0, arrayOfByte2, 0, i2);
    return arrayOfByte2;
  }

  public static BigInteger i(byte[] paramArrayOfByte)
  {
    return new BigInteger(1, e(paramArrayOfByte));
  }

  private static boolean j(byte[] paramArrayOfByte)
  {
    int i1 = 0;
    for (int i2 = 0; ; i2++)
    {
      if (i2 < paramArrayOfByte.length)
      {
        if (!a(paramArrayOfByte[i2]))
          continue;
        i1 = 1;
      }
      return i1;
    }
  }

  int a(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    int i1;
    if (this.l != null)
    {
      i1 = Math.min(b(), paramInt2);
      if (this.l != paramArrayOfByte)
      {
        System.arraycopy(this.l, this.n, paramArrayOfByte, paramInt1, i1);
        this.n = (i1 + this.n);
        if (this.n >= this.m)
          this.l = null;
      }
    }
    while (true)
    {
      return i1;
      this.l = null;
      continue;
      if (this.q)
      {
        i1 = -1;
        continue;
      }
      i1 = 0;
    }
  }

  public Object a(Object paramObject)
  {
    if (!(paramObject instanceof byte[]))
      throw new i("Parameter supplied to Base64 decode is not a byte[]");
    return a((byte[])(byte[])paramObject);
  }

  boolean a()
  {
    if (this.l != null);
    for (int i1 = 1; ; i1 = 0)
      return i1;
  }

  public byte[] a(byte[] paramArrayOfByte)
  {
    return e(paramArrayOfByte);
  }

  int b()
  {
    if (this.l != null);
    for (int i1 = this.m - this.n; ; i1 = 0)
      return i1;
  }

  public Object b(Object paramObject)
  {
    if (!(paramObject instanceof byte[]))
      throw new f("Parameter supplied to Base64 encode is not a byte[]");
    return h((byte[])(byte[])paramObject);
  }

  void b(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    if ((paramArrayOfByte != null) && (paramArrayOfByte.length == paramInt2))
    {
      this.l = paramArrayOfByte;
      this.m = paramInt1;
      this.n = paramInt1;
    }
  }

  void c(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    if (this.q);
    while (true)
    {
      return;
      if (paramInt2 < 0)
      {
        this.q = true;
        if ((this.l == null) || (this.l.length - this.m < this.k))
          c();
        switch (this.p)
        {
        default:
        case 1:
        case 2:
        }
        while (true)
        {
          if (this.h <= 0)
            break label393;
          System.arraycopy(this.i, 0, this.l, this.m, this.i.length);
          this.m += this.i.length;
          break;
          byte[] arrayOfByte9 = this.l;
          int i13 = this.m;
          this.m = (i13 + 1);
          arrayOfByte9[i13] = c[(0x3F & this.r >> 2)];
          byte[] arrayOfByte10 = this.l;
          int i14 = this.m;
          this.m = (i14 + 1);
          arrayOfByte10[i14] = c[(0x3F & this.r << 4)];
          byte[] arrayOfByte11 = this.l;
          int i15 = this.m;
          this.m = (i15 + 1);
          arrayOfByte11[i15] = 61;
          byte[] arrayOfByte12 = this.l;
          int i16 = this.m;
          this.m = (i16 + 1);
          arrayOfByte12[i16] = 61;
          continue;
          byte[] arrayOfByte5 = this.l;
          int i9 = this.m;
          this.m = (i9 + 1);
          arrayOfByte5[i9] = c[(0x3F & this.r >> 10)];
          byte[] arrayOfByte6 = this.l;
          int i10 = this.m;
          this.m = (i10 + 1);
          arrayOfByte6[i10] = c[(0x3F & this.r >> 4)];
          byte[] arrayOfByte7 = this.l;
          int i11 = this.m;
          this.m = (i11 + 1);
          arrayOfByte7[i11] = c[(0x3F & this.r << 2)];
          byte[] arrayOfByte8 = this.l;
          int i12 = this.m;
          this.m = (i12 + 1);
          arrayOfByte8[i12] = 61;
        }
        label393: continue;
      }
      int i1 = 0;
      while (i1 < paramInt2)
      {
        if ((this.l == null) || (this.l.length - this.m < this.k))
          c();
        int i2 = 1 + this.p;
        this.p = i2;
        this.p = (i2 % 3);
        int i3 = paramInt1 + 1;
        int i4 = paramArrayOfByte[paramInt1];
        if (i4 < 0)
          i4 += 256;
        this.r = (i4 + (this.r << 8));
        if (this.p == 0)
        {
          byte[] arrayOfByte1 = this.l;
          int i5 = this.m;
          this.m = (i5 + 1);
          arrayOfByte1[i5] = c[(0x3F & this.r >> 18)];
          byte[] arrayOfByte2 = this.l;
          int i6 = this.m;
          this.m = (i6 + 1);
          arrayOfByte2[i6] = c[(0x3F & this.r >> 12)];
          byte[] arrayOfByte3 = this.l;
          int i7 = this.m;
          this.m = (i7 + 1);
          arrayOfByte3[i7] = c[(0x3F & this.r >> 6)];
          byte[] arrayOfByte4 = this.l;
          int i8 = this.m;
          this.m = (i8 + 1);
          arrayOfByte4[i8] = c[(0x3F & this.r)];
          this.o = (4 + this.o);
          if ((this.h > 0) && (this.h <= this.o))
          {
            System.arraycopy(this.i, 0, this.l, this.m, this.i.length);
            this.m += this.i.length;
            this.o = 0;
          }
        }
        i1++;
        paramInt1 = i3;
      }
    }
  }

  void d(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
  {
    if (this.q);
    label429: 
    while (true)
    {
      return;
      if (paramInt2 < 0)
        this.q = true;
      int i1 = 0;
      while (true)
      {
        if (i1 >= paramInt2)
          break label429;
        if ((this.l == null) || (this.l.length - this.m < this.j))
          c();
        int i2 = paramInt1 + 1;
        int i3 = paramArrayOfByte[paramInt1];
        if (i3 == 61)
        {
          this.r <<= 6;
          switch (this.p)
          {
          default:
          case 2:
          case 3:
          }
          while (true)
          {
            this.q = true;
            break;
            this.r <<= 6;
            byte[] arrayOfByte6 = this.l;
            int i11 = this.m;
            this.m = (i11 + 1);
            arrayOfByte6[i11] = (byte)(0xFF & this.r >> 16);
            continue;
            byte[] arrayOfByte4 = this.l;
            int i9 = this.m;
            this.m = (i9 + 1);
            arrayOfByte4[i9] = (byte)(0xFF & this.r >> 16);
            byte[] arrayOfByte5 = this.l;
            int i10 = this.m;
            this.m = (i10 + 1);
            arrayOfByte5[i10] = (byte)(0xFF & this.r >> 8);
          }
        }
        if ((i3 >= 0) && (i3 < e.length))
        {
          int i4 = e[i3];
          if (i4 >= 0)
          {
            int i5 = 1 + this.p;
            this.p = i5;
            this.p = (i5 % 4);
            this.r = (i4 + (this.r << 6));
            if (this.p == 0)
            {
              byte[] arrayOfByte1 = this.l;
              int i6 = this.m;
              this.m = (i6 + 1);
              arrayOfByte1[i6] = (byte)(0xFF & this.r >> 16);
              byte[] arrayOfByte2 = this.l;
              int i7 = this.m;
              this.m = (i7 + 1);
              arrayOfByte2[i7] = (byte)(0xFF & this.r >> 8);
              byte[] arrayOfByte3 = this.l;
              int i8 = this.m;
              this.m = (i8 + 1);
              arrayOfByte3[i8] = (byte)(0xFF & this.r);
            }
          }
        }
        i1++;
        paramInt1 = i2;
      }
    }
  }

  public byte[] h(byte[] paramArrayOfByte)
  {
    return a(paramArrayOfByte, false);
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.p.a.a
 * JD-Core Version:    0.6.0
 */